<section class="item">
<?php if($enabled === TRUE): ?>
	<?php echo form_open($this->uri->uri_string(), 'class="crud" id="saef-admin"'); ?>
		<div class="form_inputs">
			<p><?php echo lang('saef:admin_available_groups_title'); ?></p>
			<ul class="saef-choices">
			<?php if ($groups): ?>
			<?php foreach($groups as $group): ?>
				<li>
					<label class="saef-field-check" for="<?php echo $group->name; ?>">
						<input type="checkbox" name="saef_group[]" id="<?php echo $group->name; ?>" value="<?php echo $group->id; ?>" <?php echo set_checkbox('saef_group', $group->id, $group->set); ?> /><?php echo $group->description; ?>
					</label>
				</li>
			<?php endforeach; ?>
				<li class="full-width">
					<label class="saef-field-check" for="saef-moderate">
						<input type="checkbox" name="saef_moderate" id="saef-moderate" value="1" <?php echo set_checkbox('saef_moderate', '1', $must_moderate); ?> /><?php echo lang('saef:admin_moderate_label'); ?>
					</label>
				</li>
			</ul>
			<?php endif; ?>
			<?php if (!empty($categories)): ?>			
			<p><?php echo lang('saef:admin_categories_help'); ?></p>			
			<ul class="saef-choices">
			<?php foreach($categories as $cat): ?>
				<li>
					<label class="saef-field-check" for="<?php echo $cat->slug; ?>">
						<input type="checkbox" name="saef_category[]" id="<?php echo $cat->slug; ?>" value="<?php echo $cat->id; ?>" <?php echo set_checkbox('saef_category', $cat->id, $cat->set); ?> /><?php echo $cat->title; ?>
					</label>
				</li>
			<?php endforeach; ?>
			</ul>
			<?php else: ?>
			<div class="no-data">
				<p class="error"><?php echo lang('saef:no_categories'); ?></p>
			</div>
			<?php endif; ?>
			<p><?php echo lang('saef:admin_edit_title'); ?>
			<ul class="saef-choices">
				<li class="third-width">
					<label class="saef-field-check" for="saef-editable">
						<input type="checkbox" name="saef_editable" id="saef-editable" value="1" <?php echo set_checkbox('saef_editable', '1', $editable); ?> /><?php echo lang('saef:admin_editable_label'); ?>
					</label>
				</li>
				<li class="third-width">
					<label class="saef-field-check" for="saef-admin-edit">
						<input type="checkbox" name="saef_admin_edit" id="saef-admin-edit" value="1" <?php echo set_checkbox('saef_admin_edit', '1', $admin_edit); ?> /><?php echo lang('saef:admin_admin_edit_label'); ?>
					</label>
				</li>
				<li class="full-width">
					<label class="saef-field-text" for="saef-editable-wrap">
						<input type="text" name="saef_editable_wrap" id="saef-editable-wrap" value="<?php echo set_value('saef_editable_wrap', $editable_wrap); ?>" /><?php echo lang('saef:admin_editable_wrap_label'); ?>
					</label>
				</li>
			</ul>
		</div>
		<div class="form_actions"><?php $this->load->view('admin/partials/buttons', array('buttons' => array('save') )); ?></div>				
	<?php echo form_close(); ?>
<?php else: ?>
	<p class="error"><?php echo lang('saef:error_not_enabled'); ?>
<?php endif; ?>
</section>